# 鸢尾花
import numpy as np
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score


X,y = load_iris(return_X_y=True)     #快速获得参数
# print(np.shape(X),np.shape(y))
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.15)


lr = LogisticRegression(max_iter=1000, multi_class='multinomial')
lr.fit(X_train,y_train)

x = accuracy_score(y_test,lr.predict(X_test))
print(x)

